class Stack{
    constructor(n){
        this.arr = new Array(n)
        this.top = -1
    }
}

//入栈
Stack.prototype.push = function(value){
    this.arr(++this.top) = value
}
//出栈
Stack.prototype.pop = function(){
    if(this.empty()) return
    return this.arr[--this.top]
}
//查看栈顶元素
Stack.prototype.peek = function(){
    if(this.empty()) return
    return this.arr[this.top]
}
//栈为空
Stack.prototype.empty = function(){
    return this.top ===-1
}
//栈中的元素
Stack.prototype